package com.Lyy.UL;

import com.Lyy.controller.StudentC;
import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ICO {

    public Object ico(String ico, String beanId) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(ico);
        Object dataSourceI = applicationContext.getBean(beanId);
        return dataSourceI;
    }
    public ApplicationContext ico(String ico) {
        ApplicationContext ClassPathXml = new ClassPathXmlApplicationContext(ico);

        return ClassPathXml;
    }
    public DruidDataSource ico(String ico,Class<DruidDataSource> bclass) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(ico);
        DruidDataSource dataSourceC = applicationContext.getBean(bclass);
        return dataSourceC;
    }
    public Object ico(String ico, String beanId, Class<DruidDataSource> bclass) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(ico);
        Object dataSourceIC = applicationContext.getBean(beanId,bclass);
        return dataSourceIC;

    }
}
